{extends file="assets::smarty-templates::Master"|ToPath}
{block name=content}
{html_css file="whiteLabel/light/jquery.datatables.css"}
{html_css file="tooltip/coda.css"}

<label><h1>Gesti&oacute;n Empresas</h1></label>    
    <fieldset>
        <div>
            <table class="datatable">
                <thead>

                    
                    <tr> 
                        <th class="sorting_asc">Identificación</th>
                        <th class="sorting">Nombre</th>

                        <th class="sorting">Actividad</th>
                        <th>Opciones</th>
                    </tr>
                </thead>

                <tbody>
                    {foreach $Empresas as $Empresa}
                        {$url = "{$action2}&Nit={$Empresa->getNIT()}"}
                        {$url2 = "{$action3}&Nit={$Empresa->getNIT()}"}
                        {$url3 = "{$action4}&Nit={$Empresa->getNIT()}"}
                        <tr>
                            <td style="vertical-align: middle">                    
                                {$Empresa->getNIT()}
                            </td>
                            <td style="vertical-align: middle">                    
                                {$Empresa->getNombre()}
                            </td>
                            <td style="vertical-align: middle">                    
                                {$Empresa->getActividad()}
                            </td>
                            <td style="vertical-align: middle">
                                <a href="{$url}" class="tooltip btn onlyicon i_pencil small" title="Editar"></a>
                                <a href="{$url2}" class="tooltip btn onlyicon i_note_book small" title="Generar Reporte"></a>
                                <a class="tooltip del btn onlyicon i_trashcan small" href="{$url3}" title="Eliminar"></a>
                            </td>
                        </tr>
                    {/foreach}                
                </tbody>
            </table>
      </div>
    <dl>
        <div>
            <a href="{$action}" class="btn icon i_plus small" >Agregar Empresa</a>
        </div>
    </dl>
</fieldset>


<script>
    {literal}
        require(["WhiteLabel.datatables", "jQuery.ToolTip", "jquery"], function(jQuery){
            jQuery(document).ready(function($){
                $("a.del").click(function(){
                    var confirm_box = confirm("Oprima click en Aceptar para confirmar eliminacion de Empresa...");
                        return confirm_box;
                });
                    
                 $(".tooltip").tooltip({
                track: true,
                delay: 0,
                fixPNG: true,
                top: -5,
                left: 30
                });

            /*
                top: 15,
                left: 10
            */    
            });
                
           
        });
    {/literal}
</script>

{/block}    